<script setup lang="ts">
//文章展示数据
import { SingleMeat } from "@/store/interface";
import Images from "@/components/block/images.vue";
import "@/components/css/home.css";
defineProps<{ data: SingleMeat[] }>();
</script>

<template>
  <section
    class="spu-item-normal-box flex-item"
    v-for="item in data"
    :key="item.id"
  >
    <a :href="item.link">
      <figure class="item-cover">
        <Images :img="item.featured_image" />
      </figure>
      <article>
        <h3>{{ item.title }}</h3>
        <h5 class="txt-product-title">{{ item.description }}</h5>
      </article>
      <aside class="item-attr-colors"></aside>
      <article class="item-price">
        <span>阅读</span>
      </article>
    </a>
  </section>
</template>

<style scoped lang="less">
.flex-four .spu-item-normal-box:hover {
  -webkit-box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.06);
}
.flex-four .spu-item-normal-box {
  position: relative;
  width: 305px;
  height: 429px;
  border: none;
  border-right: 1px solid #efefef;
  border-bottom: 1px solid #efefef;
  border-radius: initial;
  background: #fff;
  -webkit-transition: -webkit-box-shadow 0.15s ease-out;
  transition: -webkit-box-shadow 0.15s ease-out;
  transition: box-shadow 0.15s ease-out;
  transition: box-shadow 0.15s ease-out, -webkit-box-shadow 0.15s ease-out;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  .item-cover {
    display: block;
    margin: 0 auto;
    padding: 45px 0 20px;
    -webkit-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;

    img {
      display: block;
      width: 216px;
      height: 216px;
      margin: 0 auto;

      object-fit: cover;
    }
  }
  .item-attr-colors {
    margin-top: 15px;
    height: 17px;
  }
  .item-price {
    font-family: Arial;
    font-size: 18px;
    font-weight: bolder;
    color: #d44d44;
    margin: 20px 0;
    -webkit-transition: all 0.1s ease-out;
    transition: all 0.1s ease-out;
  }
  h3,
  h5 {
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  h5 {
    padding: 15px 12px 0;
    font-size: 12px;
    color: #999;
  }
}
</style>
